'use client';

import { ConfigProvider, App } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import { ThemeProvider, useTheme } from '@/components/ThemeToggle/themeContext';

// 包装配置提供者的组件
function AntdConfigProvider({ children }: { children: React.ReactNode }) {
  const { theme } = useTheme();
  
  return (
    <ConfigProvider
      locale={zhCN}
      theme={theme}
    >
      <App>{children}</App>
    </ConfigProvider>
  );
}

// 主要的提供者组件
export function AntdProvider({ children }: { children: React.ReactNode }) {
  return (
    <ThemeProvider>
      <AntdConfigProvider>{children}</AntdConfigProvider>
    </ThemeProvider>
  );
} 